//本地存储
var lcstor = window.localStorage;
function setStorage(key, value) {
    if (lcstor)
        lcstor[key] = value;
    //else 
    //alert('localStorage error');
}

function getStorage(key) {
    if (lcstor) {
        for (i in lcstor) {
            if (i == key)
                return lcstor[i];
        }
    }
    //else 
    //alert('localStorage error');
}
function loadingStart(word, time) {
    uexWindow.toast('1', '5', word, time);
	var a = document.body.scrollHeight;
    $$("diyLoadDiv").outerHTML = '<div id="diyLoadDiv" class="um-vp ulev1 up2 c-bla " style="opacity:0.5; height:'+ a +'px"></div>';

    if (isDefine(time) && time != 0) {
        loading = setInterval(diyCloseLoading, time);
    }
}
/*判断是否不为空*/
function isDefine(para) {
    if (typeof para == 'undefined' || para == "" || para == null || para == undefined)
        return false;
    else
        return true;
}
function loadingEnd() {
    uexWindow.closeToast();
    //关闭loading
    $$("diyLoadDiv").className = "uhide";
}

//测试环境：

/*
//飞机所属公司
var aircraftsUrl="http://172.31.3.190:8080/mpservice/gs_searchGS.action";
//餐食配备公司
var mealUrl="http://172.31.3.190:8080/mpservice/gs_searchCSGS.action";
//获取一个月内外站应收应付数据接口
var Url="http://172.31.3.190:8080/mpservice/zwfy_search.action";
*/

//生产环境：

//飞机所属公司
var aircraftsUrl="http://mpservice.ceair.com/mpservice/gs_searchGS.action";
//餐食配备公司
var mealUrl="http://mpservice.ceair.com/mpservice/gs_searchCSGS.action";
//获取一个月内外站应收应付数据接口
var Url="http://mpservice.ceair.com/mpservice/zwfy_search.action";

//费用表格
var totalHtml='';
//选项卡
var tabControlHtml='';




function getMealOption()
{
	$.getJSON(mealUrl, function(json){
//			console.log(JSON.stringify(json));
			var selectval='';
			var len=json.rows.length;
			for(var i=0; i<len; i++)
			{
				var row=json.rows[i];
				var str = row.F_GSMC;
				str.replace(/\s+/g,"");     
				if(str=="罗马配餐"){
				selectval+='<option checkde selected="true" value="'+row.F_GSID+'">'+str+'</option>'
				}else{
				selectval+='<option value="'+row.F_GSID+'">'+str+'</option>'
				}
			}
			$$("mealCompany").innerHTML=selectval;
    }, "json",function(err){
		alert(err);
			}, "GET",'',false);
}

function getTotalHtml(rowsArr)
{
	var JGPPLAN='7040994.1296';  //机供品计划费
var JGPEQUIP='37040994.1296';  //机供品实配费用
var JGPRECE='37040994.1296';  //机供品实收费用
var CSPLAN='563377.04107';  //餐食计划费用
var CSEQUIP='563377.04107';  //餐食实配费用
var CSRECE='0';  //餐食实收费用
var SERVICEPLAN='0';  //服务费计划费用
var SERVICEEQUIP='0';  //服务费实配费用
var SERVICERECE='0';  //服务费实收费用
//测试暂时屏蔽	
    JGPPLAN = rowsArr.JGPPLAN;
	JGPEQUIP = rowsArr.JGPEQUIP;
	JGPRECE = rowsArr.JGPRECE;
	CSPLAN = rowsArr.CSPLAN;
	CSEQUIP = rowsArr.CSEQUIP;
	CSRECE = rowsArr.CSRECE;
	SERVICEPLAN = rowsArr.SERVICEPLAN;
	SERVICEEQUIP = rowsArr.SERVICEEQUIP;
	SERVICERECE = rowsArr.SERVICERECE;
	JGPPLAN==""?"-":rowsArr.JGPPLAN;  
	JGPEQUIP==""?"-":rowsArr.JGPEQUIP; 
	JGPRECE==""?"-":rowsArr.JGPRECE; 
	CSPLAN==""?"-":rowsArr.CSPLAN; 
	CSEQUIP==""?"-":rowsArr.CSEQUIP; 
	CSRECE==""?"-":rowsArr.CSRECE; 
	SERVICEPLAN==""?"-":rowsArr.SERVICEPLAN; 
	SERVICEEQUIP==""?"-":rowsArr.SERVICEEQUIP; 
	SERVICERECE==""?"-":rowsArr.SERVICERECE;  

totalHtml='<table class="tb ulev-1">\
							  <tr>\
							    <th class="tbh">&nbsp;</th>\
							    <th class="tbh">计付</th>\
								<th class="tbh">实配</th>\
								<th class="tbh">实收</th>\
							  </tr>\
							    <tr>\
							    <td class="tbd">机供品</th>\
							    <td class="tbd">'+JGPPLAN+'</th>\
								<td class="tbd">'+JGPEQUIP+'</th>\
								<td class="tbd">'+JGPRECE+'</th>\
							  </tr>\
							    <tr>\
							    <td class="tbd">餐食费</th>\
							    <td class="tbd">'+CSPLAN+'</th>\
								<td class="tbd">'+CSEQUIP+'</th>\
								<td class="tbd">'+CSRECE+'</th>\
							  </tr>\
							    <tr>\
							    <td class="tbd">服务费</th>\
							    <td class="tbd">'+SERVICEPLAN+'</th>\
								<td class="tbd">'+SERVICEEQUIP+'</th>\
								<td class="tbd">'+SERVICERECE+'</th>\
							  </tr>\
						</table>';
								
}

function getTabControlHtml()
{
	tabControlHtml='<div class="subtab "   onclick="tabCheck(0)" >\
                <div class="subtabUp" id="tab0" name="tabbutton">机供品</div>\
            </div>\
            <div class=" subtab" onclick="tabCheck(1)">\
                <div class="subtabUp"  id="tab1" name="tabbutton">餐食</div>\
            </div>\
			 <div class="subtab" onclick="tabCheck(2)">\
                <div class="subtabUp" id="tab2" name="tabbutton">服务费</div>\
            </div>\
            <div class="subtab" onclick="tabCheck(3)">\
                <div class="subtabUp" id="tab3"  name="tabbutton">总计</div>\
        </div>';

	return tabControlHtml;
}


function tabCheck(num)
{
	setStorage("tabnum",num);
	buttonUp("tab",[0,1,2,3]);
	$$("tab"+num).className="subtabDown";
	switch(num)
	{
		case 0:
			$$("details").innerHTML = jgpHtml;
		break;
		case 1:
			$$("details").innerHTML = csHtml;
		break;
		case 2:
			$$("details").innerHTML = serviceHtml;
		break;
		case 3:
			$$("details").innerHTML = zjHtml;
		break;
	}
}

function buttonUp(pre,idArr)
{
	for(var i=0;i<idArr.length;i++)
	{
		$$(pre+idArr[i]).className="subtabUp";
	}
	
}


var jgpHtml='';
var csHtml='';
var serviceHtml='';
var zjHtml='';

/**
 * 画详细表格
 * @param {Object} data
 */
function summaryHtml(arr)
{
	len=arr.length;
//	alert("--"+len)
	for(var i=0;i<len;i++)
	{
		var FLIGHTDATE=arr[i].FLIGHTDATE.substr(2).replace(/-/g,"/");
		var HXMC=arr[i].HXMC;
		var hzO=HXMC.split("-")[0];  //始发站
		var hzD=HXMC.split("-")[1];	//目的站
		var HX=arr[i].HX;
		var hxO=HX.split("-")[0];  //航线前
		var hxD=HX.split("-")[1];	//航线后
		var FLIGHTNO=arr[i].FLIGHTNO;
		var JGPPLAN=arr[i].JGPPLAN;
		var JGPEQUIP=arr[i].JGPEQUIP;
		var JGPRECE=arr[i].JGPRECE;
		
		var CSPLAN=arr[i].CSPLAN;
		var CSEQUIP=arr[i].CSEQUIP;
		var CSRECE=arr[i].CSRECE;
		var SERVICESPLAN=arr[i].SERVICESPLAN;
		var SERVICESEQUIP=arr[i].SERVICESEQUIP;
		var SERVICESRECE=arr[i].SERVICESRECE;
		var SUMMARYPLAN=arr[i].SUMMARYPLAN;
		var SUMMARYEQUIP=arr[i].SUMMARYEQUIP;
		var SUMMARYRECE=arr[i].SUMMARYRECE;
		
		var F_FJJH=arr[i].F_FJJH;
		var F_JXBM=arr[i].F_JXBM;
		
		var fligthdate=arr[i].FLIGHTDATE.split(' ')[0];
		jgpHtml +='<tr onclick="detailPage(\''+fligthdate+'\',\'' +F_FJJH+ '\',\'' +F_JXBM+ '\',\'' +HX+ '\')">\
							<td class="detailtd ulev-3" id="FLIGHTDATE">'+FLIGHTDATE+'</td>\
							<td class="detailtd ulev-3" id="hxName">'+hzO+'<br>-'+hzD+'</td>\
							<td class="detailtd ulev-3" id="flightNo">'+FLIGHTNO+'</td>\
							<td class="detailtd ulev-3">'+JGPPLAN+'</td>\
							<td class="detailtd ulev-3">'+JGPEQUIP+'</td>\
							<td class="detailtd ulev-3">'+JGPRECE+'</td>\
						</tr>'; 
		
		csHtml +='<tr onclick="detailPage(\''+F_FJJH+'\',\'' +F_JXBM+ '\')">\
							<td class="detailtd ulev-3" id="FLIGHTDATE">'+FLIGHTDATE+'</td>\
							<td class="detailtd ulev-3" id="hxName">'+hzO+'<br>-'+hzD+'</td>\
							<td class="detailtd ulev-3" id="flightNo">'+FLIGHTNO+'</td>\
							<td class="detailtd ulev-3">'+CSPLAN+'</td>\
							<td class="detailtd ulev-3">'+CSEQUIP+'</td>\
							<td class="detailtd ulev-3">'+CSRECE+'</td>\
						</tr>'; 
		serviceHtml +='<tr onclick="detailPage(\''+F_FJJH+'\',\'' +F_JXBM+ '\')">\
							<td class="detailtd ulev-3" id="FLIGHTDATE">'+FLIGHTDATE+'</td>\
							<td class="detailtd ulev-3" id="hxName">'+hzO+'<br>-'+hzD+'</td>\
							<td class="detailtd ulev-3" id="flightNo">'+FLIGHTNO+'</td>\
							<td class="detailtd ulev-3">'+SERVICESPLAN+'</td>\
							<td class="detailtd ulev-3">'+SERVICESEQUIP+'</td>\
							<td class="detailtd ulev-3">'+SERVICESRECE+'</td>\
						</tr>'; 
		zjHtml +='<tr onclick="detailPage(\''+F_FJJH+'\',\'' +F_JXBM+ '\')">\
							<td class="detailtd ulev-3" id="FLIGHTDATE">'+FLIGHTDATE+'</td>\
							<td class="detailtd ulev-3" id="hxName">'+hzO+'<br>-'+hzD+'</td>\
							<td class="detailtd ulev-3" id="flightNo">'+FLIGHTNO+'</td>\
							<td class="detailtd ulev-3">'+SUMMARYPLAN+'</td>\
							<td class="detailtd ulev-3">'+SUMMARYEQUIP+'</td>\
							<td class="detailtd ulev-3">'+SUMMARYRECE+'</td>\
						</tr>'; 			
	}
}

var cabin='Y';//舱位

var jgpHtmlDaily_C='';
var jgpHtmlDaily_F='';
var jgpHtmlDaily_Y='';
var csHtmlDaily_C='';
var csHtmlDaily_F='';
var csHtmlDaily_Y='';
var serviceHtmlDaily_C='';
var serviceHtmlDaily_F='';
var serviceHtmlDaily_Y='';

var zjHtmlDaily_C='';
var zjHtmlDaily_F='';
var zjHtmlDaily_Y='';

function dataClassify(row){
	var len=row.length;
	for(var i=0;i<len;i++)
	{
		var F_CWDM=row[i].F_CWDM;
		
		var F_JHCSZLMC=row[i].F_JHCSZLMC;
		var F_JHCBMC=row[i].F_JHCBMC;
		var F_SPCSZLMC=row[i].F_SPCSZLMC;
		var F_SPCBMC=row[i].F_SPCBMC;
		
		var JGPPLAN=row[i].JGPPLAN;
		var JGPEQUIP=row[i].JGPEQUIP;
		var JGPRECE=row[i].JGPRECE;
		
		var CSPLAN=row[i].CSPLAN;
		var CSEQUIP=row[i].CSEQUIP;
		var CSRECE=row[i].CSRECE;
		
		var SERVICESPLAN=row[i].SERVICESPLAN;
		var SERVICESEQUIP=row[i].SERVICESEQUIP;
		var SERVICESRECE=row[i].SERVICESRECE;
		
		var SUMMARYPLAN=row[i].SUMMARYPLAN;
		var SUMMARYEQUIP=row[i].SUMMARYEQUIP;
		var SUMMARYRECE=row[i].SUMMARYRECE;
		switch(F_CWDM)
		{
			case "C":
					jgpHtmlDaily_C +='<tr>\
						<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
						<td class="detailtd ulev-3">'+JGPPLAN+'</td>\
						<td class="detailtd ulev-3">'+JGPEQUIP+'</td>\
						<td class="detailtd ulev-3">'+JGPRECE+'</td>\
					</tr>'; 
		
					csHtmlDaily_C +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+CSPLAN+'</td>\
								<td class="detailtd ulev-3">'+CSEQUIP+'</td>\
								<td class="detailtd ulev-3">'+CSRECE+'</td>\
							</tr>'; 
				
					serviceHtmlDaily_C +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SERVICESPLAN+'</td>\
								<td class="detailtd ulev-3">'+SERVICESEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SERVICESRECE+'</td>\
							</tr>'; 
				
					zjHtmlDaily_C +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYPLAN+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYRECE+'</td>\
							</tr>'; 	
			break;
			case "F":
				jgpHtmlDaily_F +='<tr>\
						<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
						<td class="detailtd ulev-3">'+JGPPLAN+'</td>\
						<td class="detailtd ulev-3">'+JGPEQUIP+'</td>\
						<td class="detailtd ulev-3">'+JGPRECE+'</td>\
					</tr>'; 
		
					csHtmlDaily_F +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+CSPLAN+'</td>\
								<td class="detailtd ulev-3">'+CSEQUIP+'</td>\
								<td class="detailtd ulev-3">'+CSRECE+'</td>\
							</tr>'; 
				
					serviceHtmlDaily_F +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SERVICESPLAN+'</td>\
								<td class="detailtd ulev-3">'+SERVICESEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SERVICESRECE+'</td>\
							</tr>'; 
				
					zjHtmlDaily_F +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYPLAN+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYRECE+'</td>\
							</tr>'; 	
			break;
			case "Y":
				jgpHtmlDaily_Y +='<tr>\
						<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
						<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
						<td class="detailtd ulev-3">'+JGPPLAN+'</td>\
						<td class="detailtd ulev-3">'+JGPEQUIP+'</td>\
						<td class="detailtd ulev-3">'+JGPRECE+'</td>\
					</tr>'; 
		
					csHtmlDaily_Y  +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+CSPLAN+'</td>\
								<td class="detailtd ulev-3">'+CSEQUIP+'</td>\
								<td class="detailtd ulev-3">'+CSRECE+'</td>\
							</tr>'; 
				
					serviceHtmlDaily_Y  +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SERVICESPLAN+'</td>\
								<td class="detailtd ulev-3">'+SERVICESEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SERVICESRECE+'</td>\
							</tr>'; 
				
					zjHtmlDaily_Y  +='<tr>\
								<td class="detailtd ulev-3">'+F_JHCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_JHCBMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCSZLMC+'</td>\
								<td class="detailtd ulev-3">'+F_SPCBMC+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYPLAN+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYEQUIP+'</td>\
								<td class="detailtd ulev-3">'+SUMMARYRECE+'</td>\
							</tr>'; 	
			break;
		}
	
	}
}


function testStr(str){
	var splitFirst = str.split('<br>');
    var ResultString = splitFirst.join('');
	return ResultString;
}
function detailPage(fd,fjjh,fjjx,hx)
{
	setStorage("flightDate_detail",fd);
	setStorage("hxName",testStr(document.getElementById("hxName").innerHTML));
	setStorage("hx",hx);
	setStorage("flightNo",document.getElementById("flightNo").innerHTML);
	setStorage("fjjh",fjjh); //机号
	setStorage("fjjx",fjjx);  //机型
	openNewWin('accountsDetail','accountsDetail.html');
}

function getTabControlHtmlDetail()
{
	var tabControlHtml='<div class="subtab "   onclick="tabCheckDetail(0)" >\
                <div class="subtabUp" id="tabDetail0" name="tabbutton">机供品</div>\
            </div>\
            <div class=" subtab" onclick="tabCheckDetail(1)">\
                <div class="subtabUp"  id="tabDetail1" name="tabbutton">餐食</div>\
            </div>\
			 <div class="subtab" onclick="tabCheckDetail(2)">\
                <div class="subtabUp" id="tabDetail2" name="tabbutton">服务费</div>\
            </div>\
            <div class="subtab" onclick="tabCheckDetail(3)">\
                <div class="subtabUp" id="tabDetail3"  name="tabbutton">总计</div>\
        </div>';
	return tabControlHtml;
}

function tabCheckDetail(num)
{
//	alert(num+ " / "+cabin)
	setStorage("number",num);
	buttonUp("tabDetail",[0,1,2,3]);
	$$("tabDetail"+num).className="subtabDown";
//		$$("subdetails").innerHTML="";
	switch(num)
	{
		case 0:
			if(cabin=='C')
			{
				$$("subdetails").innerHTML = jgpHtmlDaily_C;
			}else if(cabin=='F')
			{
				$$("subdetails").innerHTML = jgpHtmlDaily_F;
			}else{
				$$("subdetails").innerHTML = jgpHtmlDaily_Y;
			}
			
		break;
		case 1:
			if(cabin=='C')
			{
				$$("subdetails").innerHTML =csHtmlDaily_C;
			}else if(cabin=='F')
			{
				$$("subdetails").innerHTML = csHtmlDaily_F;
			}else{
				$$("subdetails").innerHTML =csHtmlDaily_Y;
			}
//			$$("subdetails").innerHTML = csHtmlDaily;
		break;
		case 2:
			if(cabin=='C')
			{
				$$("subdetails").innerHTML =serviceHtmlDaily_C;
			}else if(cabin=='F')
			{
				$$("subdetails").innerHTML = serviceHtmlDaily_F;
			}else{
				$$("subdetails").innerHTML =serviceHtmlDaily_Y;
			}
//			$$("subdetails").innerHTML = serviceHtmlDaily;
		break;
		case 3:
			if(cabin=='C')
			{
				$$("subdetails").innerHTML =zjHtmlDaily_C;
			}else if(cabin=='F')
			{
				$$("subdetails").innerHTML = zjHtmlDaily_F;
			}else{
				$$("subdetails").innerHTML =zjHtmlDaily_Y;
			}
//			$$("subdetails").innerHTML = zjHtmlDaily;
		break;
	}
}

function getAircraftOption()
{
	$.getJSON(aircraftsUrl, function(json){
//			console.log(JSON.stringify(json));
			var selectval='';
			var len=json.rows.length;
			for(var i=0; i<len; i++)
			{
				var row=json.rows[i];
				selectval+='<option value="'+row.F_GSID+'">'+row.F_GSMC+'</option>'
			}
			$$("aircraftCompany").innerHTML=selectval;
    }, "json",function(err){
		alert(err);
			}, "GET",'',false);
}


var json_GetASAPTotal_OneDay;
var json_GetASAPSummary_OneDay;
var json_GetASAPTotal;
var json_GetASAPSummary;
var json_GetASAPDetail;
/***
 * 数据请求：GetASAPTotal-总费用表，GetASAPSummary-详细总列表，json_GetASAPDetail-详细列表
 * @param {Object} idata
 * @param {Object} type
 */
function dataRequest(idata,type)
{
//	alert("idata: "+JSON.stringify(idata))
	$.getJSON(Url, function(json){
			if(json!=null)
			{
				if(json.errorCode==0)
				{
					switch(type)
					{
						case "GetASAPTotal":
						case "GetASAPTotalOneDay":
							json_GetASAPTotal=json;
						break;
						case "GetASAPSummary":
						case "GetASAPSummaryOneDay":
							json_GetASAPSummary=json;
						break;
						case "GetASAPDetail":
						break;
					}
//					console.log(type+" : "+JSON.stringify(json));
				}else
				{
//					$alert(json.errorMsg);   //错误提示
				}
			}
			
    }, "json",function(err){
 			alert(type+". err: "+err);
			}, "POST",idata,false);
}



function restSummaryData()
{
	 jgpHtml='';
	 csHtml='';
	 serviceHtml='';
	 zjHtml='';
}
//alert("reload")
function restDetailData()
{
	  jgpHtmlDaily_C='';
	  jgpHtmlDaily_F='';
	  jgpHtmlDaily_Y='';
	  csHtmlDaily_C='';
	  csHtmlDaily_F='';
	  csHtmlDaily_Y='';
	  serviceHtmlDaily_C='';
	  serviceHtmlDaily_F='';
	  serviceHtmlDaily_Y='';
	
	  zjHtmlDaily_C='';
	  zjHtmlDaily_F='';
	  zjHtmlDaily_Y='';
}

